package gui.curso;

import java.awt.Frame;

import javax.swing.JDialog;
import javax.swing.JButton;
import java.awt.Rectangle;

public class DialogoAgregarCurso extends JDialog {

	private static final long serialVersionUID = 1L;
	private PanelAgregarCurso panelAgregarCurso = null;
	private JButton btnSalir = null;
	private static DialogoAgregarCurso instancia = null;

	public static DialogoAgregarCurso getInstancia() {
		if (instancia == null) {
			instancia = new DialogoAgregarCurso(null);
		}
		return instancia;
	}

	/**
	 * @param owner
	 */
	private DialogoAgregarCurso(Frame owner) {
		super(owner);

		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setResizable(false);
		this.setTitle("Panel Agregar Curso");
		this.setLocationRelativeTo(null);
		this.setModal(true);
		this.setSize(510, 448);
		this.setContentPane(getPanelAgregarCurso());
		this.setLocationRelativeTo(null);
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private PanelAgregarCurso getPanelAgregarCurso() {
		if (panelAgregarCurso == null) {
			panelAgregarCurso = new PanelAgregarCurso();
			panelAgregarCurso.setLayout(null);
			panelAgregarCurso.add(getBtnSalir(), null);
		}
		return panelAgregarCurso;
	}

	/**
	 * This method initializes btnSalir
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getBtnSalir() {
		if (btnSalir == null) {
			btnSalir = new JButton();
			btnSalir.setBounds(new Rectangle(204, 386, 91, 25));
			btnSalir.setText("Salir");
			btnSalir.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					DialogoAgregarCurso.this.cerra();
				}
			});
		}
		return btnSalir;
	}

	public void cerra() {
		this.dispose();
	}

} // @jve:decl-index=0:visual-constraint="10,10"
